package com.mbc.hr.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

@SuppressWarnings("serial")
@Entity()
@Table(name="HR_Employee")
@NamedQueries({
	@NamedQuery(name="Employee.findByEmployeeNo", query="SELECT e FROM Employee e WHERE e.employeeNo = :employeeNo"),
	@NamedQuery(name="Employee.findByFingerPrintID", query="SELECT e FROM Employee e WHERE e.fingerPrintID = :fingerPrintID"),
	@NamedQuery(name="Employee.findByName", query="SELECT e FROM Employee e WHERE e.name = :name"),
	@NamedQuery(name="Employee.findByEmployeeGroupID",query="SELECT e FROM Employee e WHERE e.employeeGroupID = :employeeGroupID AND e.status <> :status"),
	@NamedQuery(name="Employee.findAll", query="SELECT e FROM Employee e WHERE e.status <> :status"),
	@NamedQuery(name="Employee.findAllByBranch", query="SELECT e FROM Employee e WHERE e.branchId = :branchId AND e.status <> :status"),
	@NamedQuery(name="Employee.findAllByLeaveSchemeID",query="SELECT e FROM Employee e, EmployeeGroup eg, LeaveScheme ls WHERE e.employeeGroupID = eg.employeeGroupID AND eg.leaveSchemeID = ls.leaveSchemeID AND ls.leaveSchemeID = :leaveSchemeID AND e.status <> :status"),
	@NamedQuery(name="Employee.findAllBySupervisor",query="SELECT e FROM Employee e WHERE e.supervisor = :supervisorID AND e.status <> :status"),
	@NamedQuery(name="Employee.findAllByDepartment",query="SELECT e FROM Employee e WHERE e.departmentID = :departmentID AND e.status <> :status")
})
public class Employee implements Serializable {

	@Id
	private Long employeeID;
	private Date createdDate;
	private Long createdBy;
	private Long branchId;
	private Byte status;
	private Long departmentID;
	private Long supervisor;
	private String employeeNo;
	private String name;
	private String email;
	private String officePhone;
	private String mobile;
	private Date hiredDate;
	private Date actionDate;
	private Long jobTitleID;
	private String photo;
	private Long employmentTypeID;
	private Long employeeGroupID;
	private Long fingerPrintID;
	
	@Transient
	private String jobTitleName;

	public Long getEmployeeID(){
		return employeeID;
	}

	public void setEmployeeID(Long employeeID){
		this.employeeID = employeeID;
	}

	public Date getCreatedDate(){
		return createdDate;
	}

	public void setCreatedDate(Date createdDate){
		this.createdDate = createdDate;
	}

	public Long getCreatedBy(){
		return createdBy;
	}

	public void setCreatedBy(Long createdBy){
		this.createdBy = createdBy;
	}

	public Byte getStatus(){
		return status;
	}

	public void setStatus(Byte status){
		this.status = status;
	}

	public Long getBranchId(){
		return branchId;
	}

	public void setBranchId(Long branchId){
		this.branchId = branchId;
	}

	public Long getDepartmentID(){
		return departmentID;
	}

	public void setDepartmentID(Long departmentID){
		this.departmentID = departmentID;
	}

	public Long getSupervisor(){
		return supervisor;
	}

	public void setSupervisor(Long supervisor){
		this.supervisor = supervisor;
	}

	public String getEmployeeNo(){
		return employeeNo;
	}

	public void setEmployeeNo(String employeeNo){
		this.employeeNo = employeeNo;
	}

	public String getName(){
		return name;
	}

	public void setName(String name){
		this.name = name;
	}

	public String getEmail(){
		return email;
	}

	public void setEmail(String email){
		this.email = email;
	}

	public String getOfficePhone(){
		return officePhone;
	}

	public void setOfficePhone(String officePhone){
		this.officePhone = officePhone;
	}

	public String getMobile(){
		return mobile;
	}

	public void setMobile(String mobile){
		this.mobile = mobile;
	}

	public Date getHiredDate() {
		return hiredDate;
	}

	public void setHiredDate(Date hiredDate) {
		this.hiredDate = hiredDate;
	}

	public Date getActionDate() {
		return actionDate;
	}

	public void setActionDate(Date actionDate) {
		this.actionDate = actionDate;
	}

	public Long getEmploymentTypeID() {
		return employmentTypeID;
	}

	public void setEmploymentTypeID(Long employmentTypeID) {
		this.employmentTypeID = employmentTypeID;
	}

	public Long getJobTitleID(){
		return jobTitleID;
	}

	public void setJobTitleID(Long jobTitleID){
		this.jobTitleID = jobTitleID;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getJobTitleName() {
		return jobTitleName;
	}

	public void setJobTitleName(String jobTitleName) {
		this.jobTitleName = jobTitleName;
	}

	public Long getEmployeeGroupID() {
		return employeeGroupID;
	}

	public void setEmployeeGroupID(Long employeeGroupID) {
		this.employeeGroupID = employeeGroupID;
	}

	public Long getFingerPrintID() {
		return fingerPrintID;
	}

	public void setFingerPrintID(Long fingerPrintID) {
		this.fingerPrintID = fingerPrintID;
	}


}
